/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package trirparser.ontologija;

import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.Property;
import com.hp.hpl.jena.rdf.model.Resource;
import java.io.PrintWriter;

public class VremeOntologija {
    
    private Model model;
    private Resource vr;
    private Property pr;
    
    private Property pMesto;
    private Property pStanje;
    private Property pTem;
    private Property pVlaznost;
    private Property pSlika;
    private Property pSmer;
    private Property pHitrost;
    private Property pDatum;
    
    private String mesto;
    private String stanje;
    private String temperatura;
    private String vlaznost;
    private String slika;
    private String smerVeter;
    private String hitrostVeter;
    private String datum;

    public String getDatum() {
        return datum;
    }

    public String getMesto() {
        return mesto;
    }
    
   
    
    private String imeDatoteke;
    
    private final String vreme = "vreme";
    private final String vremeNS = "ftp://ftp.ribogojnica-pozeg.si/";
    private final String uri = "ftp://ftp.ribogojnica-pozeg.si/";
    
    
    public VremeOntologija(String imeDatoteke) {
        model = ModelFactory.createDefaultModel();
        this.imeDatoteke = imeDatoteke;
        
        model.setNsPrefix(vreme, vremeNS);
        generirajVreme();
        generirajLastnosti();
        
    }

    private void generirajLastnosti() {        
        pSlika = model.createProperty(vremeNS, "slika");
        pHitrost = model.createProperty(vremeNS, "hitrostVetra");
        pSmer = model.createProperty(vremeNS, "smerVetra");
        pVlaznost = model.createProperty(vremeNS, "vlaznost");
        pTem = model.createProperty(vremeNS, "temperatura");
        pStanje = model.createProperty(vremeNS, "stanje");
        pDatum = model.createProperty(vremeNS, "datum");
        pMesto = model.createProperty(vremeNS, "mesto");
    }

    private void generirajVreme() {
        vr = model.createResource(uri + imeDatoteke);
        pr = model.createProperty(vremeNS, "vreme");
        vr.addProperty(pr, model.createResource(vremeNS+"Vreme"));
        
        /***/
    }

    public void setDatum(String datum) {
        vr.removeAll(pDatum);
        if(!datum.isEmpty())
            vr.addProperty(pDatum, datum);
    }

    public void setHitrostVeter(String hitrostVeter) {
        vr.removeAll(pHitrost);
        if(!hitrostVeter.isEmpty())
            vr.addProperty(pHitrost, hitrostVeter);
    }

    public void setMesto(String mesto) {
        vr.removeAll(pMesto);
        if(!mesto.isEmpty())
            vr.addProperty(pMesto, mesto);
    }

    public void setSlika(String slika) {
        vr.removeAll(pSlika);
        if(!slika.isEmpty())
            vr.addProperty(pSlika, slika);
    }

    public void setSmerVeter(String smerVeter) {
        vr.removeAll(pSmer);
        if(!smerVeter.isEmpty())
            vr.addProperty(pSmer, smerVeter);
    }

    public void setStanje(String stanje) {
        vr.removeAll(pStanje);
        if(!stanje.isEmpty())
            vr.addProperty(pStanje, stanje);
    }

    public void setTemperatura(String temperatura) {
        vr.removeAll(pTem);
        if(!temperatura.isEmpty())
            vr.addProperty(pTem, temperatura);
    }

    public void setVlaznost(String vlaznost) {
        vr.removeAll(pVlaznost);
        if(!vlaznost.isEmpty())
            vr.addProperty(pVlaznost, vlaznost);
    }

    public Model getModel() {
        return model;
    }

    public String getImeDatoteke() {
        return imeDatoteke;
    }
    
    
    
}
